package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysGateway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysGatewayCycleMapper;
import com.ruoyi.system.domain.SysGatewayCycle;
import com.ruoyi.system.service.ISysGatewayCycleService;

import javax.annotation.Resource;

/**
 * 网关采集周期Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-30
 */
@Service
public class SysGatewayCycleServiceImpl implements ISysGatewayCycleService 
{
    @Autowired
    private SysGatewayCycleMapper sysGatewayCycleMapper;

    /**
     * 查询网关采集周期
     * 
     * @param gatewayId 网关采集周期主键
     * @return 网关采集周期
     */
    @Override
    public SysGatewayCycle selectSysGatewayCycleByGatewayId(Long gatewayId)
    {
        return sysGatewayCycleMapper.selectSysGatewayCycleByGatewayId(gatewayId);
    }

    /**
     * 查询网关采集周期列表
     * 
     * @param sysGatewayCycle 网关采集周期
     * @return 网关采集周期
     */
    @Override
    public List<SysGatewayCycle> selectSysGatewayCycleList(SysGatewayCycle sysGatewayCycle)
    {
        return sysGatewayCycleMapper.selectSysGatewayCycleList(sysGatewayCycle);
    }


    /**
     * 查询网关列表
     * @param sysGateway
     * @return
     */
    @Override
    public List<SysGateway> selectSysGatewayList(SysGateway sysGateway){
        return sysGatewayCycleMapper.selectSysGatewayList(sysGateway);
    }
    /**
     * 新增网关采集周期
     * 
     * @param sysGatewayCycle 网关采集周期
     * @return 结果
     */
    @Override
    public int insertSysGatewayCycle(SysGatewayCycle sysGatewayCycle)
    {
        sysGatewayCycle.setCreateTime(DateUtils.getNowDate());
        return sysGatewayCycleMapper.insertSysGatewayCycle(sysGatewayCycle);
    }

    /**
     * 修改网关采集周期
     * 
     * @param sysGatewayCycle 网关采集周期
     * @return 结果
     */
    @Override
    public int updateSysGatewayCycle(SysGatewayCycle sysGatewayCycle)
    {
        sysGatewayCycle.setUpdateTime(DateUtils.getNowDate());
        return sysGatewayCycleMapper.updateSysGatewayCycle(sysGatewayCycle);
    }

    /**
     * 批量删除网关采集周期
     * 
     * @param gatewayIds 需要删除的网关采集周期主键
     * @return 结果
     */
    @Override
    public int deleteSysGatewayCycleByGatewayIds(Long[] gatewayIds)
    {
        return sysGatewayCycleMapper.deleteSysGatewayCycleByGatewayIds(gatewayIds);
    }

    /**
     * 删除网关采集周期信息
     * 
     * @param gatewayId 网关采集周期主键
     * @return 结果
     */
    @Override
    public int deleteSysGatewayCycleByGatewayId(Long gatewayId)
    {
        return sysGatewayCycleMapper.deleteSysGatewayCycleByGatewayId(gatewayId);
    }
}
